"use client"

import { Sidebar } from "@/components/sidebar"
import { useDashboardStats } from "@/hooks/use-dashboard-stats"
import { DeviceTypeTree } from "@/components/device-type-tree"
import { Badge } from "@/components/ui/badge"

export default function CommunicationPage() {
  // 获取统一的数据源用于侧边栏
  const { stats: dashboardStats } = useDashboardStats()

  return (
    <div className="flex h-screen bg-gray-50">
      <Sidebar
        dataCounts={dashboardStats || {}}
      />
      <div className="flex-1 flex flex-col overflow-hidden">
        <div className="flex-1 overflow-auto">
          <div className="container mx-auto py-8">
            <div className="mb-8">
              <div className="flex items-center gap-4 mb-4">
                <h1 className="text-4xl font-bold text-primary">实体对象分类及属性管理系统</h1>
                <Badge className="blue-badge-solid">通信专业</Badge>
              </div>
              <p className="text-muted-foreground">管理通信专业设备类型、设备实例和参数录入</p>
            </div>
            
            {/* 使用新的设备类型树组件 */}
            <DeviceTypeTree specialty="通信专业" />
          </div>
        </div>
      </div>
    </div>
  )
}